package com.zcxy.fast.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zcxy.fast.bean.BaseEntity;
import com.zcxy.fast.mybatisExtend.anotation.OneToMany;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;

/**
 * 单表代码生成组件以及校验测试
 *
 * @author zcc
 * @email 860474958@qq.com
 * @date 2021-01-07 11:18:42
 */
@Data
@TableName(value = "sys_test", autoResultMap = true)
@ApiModel(value = "SysTest", description = "单表代码生成组件以及校验测试")
public class SysTest extends BaseEntity {

    @NotEmpty(message = "tinput为必填字段")
    @Length(max = 255, message = "tinput 超出最大长度：255")
    @ApiModelProperty(value = " 文本组件", required = false)
    private String tinput;

    @ApiModelProperty(value = " 数字", required = false)
    private BigDecimal number;

    @NotEmpty(message = "tdate为必填字段")
    @Length(max = 255, message = "tdate 超出最大长度：255")
    @ApiModelProperty(value = " 日期组件", required = false)
    private String tdate;

    @NotEmpty(message = "tselect为必填字段")
    @Length(max = 255, message = "tselect 超出最大长度：255")
    @ApiModelProperty(value = " 下拉组件测试", required = false)
    private String tselect;

    @NotEmpty(message = "tree为必填字段")
    @Length(max = 255, message = "tree 超出最大长度：255")
    @ApiModelProperty(value = " 树组件", required = false)
    private String tree;

    @NotEmpty(message = "email为必填字段")
    @Length(max = 255, message = "email 超出最大长度：255")
    @ApiModelProperty(value = " 邮箱", required = false)
    private String email;

    @NotEmpty(message = "phone为必填字段")
    @Length(max = 255, message = "phone 超出最大长度：255")
    @ApiModelProperty(value = " 手机号", required = false)
    private String phone;

    @NotEmpty(message = "textarea为必填字段")
    @Length(max = 255, message = "textarea 超出最大长度：255")
    @ApiModelProperty(value = " 文本域组件", required = false)
    private String textarea;

    @TableId(type = IdType.UUID)
    @Length(max = 32, message = "id 超出最大长度：32")
    @ApiModelProperty(value = " 主键", required = false)
    private String id;

    @TableField(exist = false)
    private List<SysAttachment> textareaAttachs;


}
